package com.bit.cfdi.web.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.bit.cfdi.web.dao.ContactoDAO;
import com.bit.cfdi.web.domain.Contacto;
@Service
public class ContactoService {

	@Autowired ContactoDAO contactoDAO;
	
	public void save(Contacto contacto) throws DataAccessException {
		contactoDAO.save(contacto);
	}
	
	public void delete(final Contacto contacto) throws DataAccessException {
		contactoDAO.delete(contacto);
	}

	public Contacto getById(Long id) throws DataAccessException {
		return contactoDAO.getById(id);
	}

	public List<Contacto> getAll() throws DataAccessException {
		return contactoDAO.getAll();
	}

}
